import Vue from 'vue'
import Router from 'vue-router'

import Home from '~/components/Home'
import Dashboard from '~/views/Dashboard'
import Login from '~/views/Login'

import ServerList from '~/views/ServerList'
import ServerDetails from '~/views/ServerDetails'

import StreamList from '~/views/StreamList'

import ActionList from '~/views/ActionList'
import ActionDetails from '~/views/ActionDetails'
import ErrorList from '~/views/ErrorList'
import ApplicationList from '~/views/ApplicationList'
import ApplicationDetails from '~/views/ApplicationDetails'
import LogList from '~/views/LogList'
import UserList from '~/views/UserList'
import ServerSetting from '~/views/ServerSetting'
import RuleList from '~/views/RuleList'
import RuleDetails from '~/views/RuleDetails'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Home,
      children: [
        {
          path: '/',
          component: Dashboard,
        },
        {
          path: '/server',
          component: ServerList,
        },
        {
          path: '/server/:id',
          component: ServerDetails,
        },
        {
          path: '/rule',
          component: RuleList,
        },
        {
          path: '/rule/:id',
          component: RuleDetails,
        },
        {
          path: '/stream',
          component: StreamList,
        },
        {
          path: '/action',
          component: ActionList,
        },
        {
          path: '/action/:id',
          component: ActionDetails,
        },
        {
          path: '/error',
          component: ErrorList,
        },
        {
          path: '/application',
          component: ApplicationList,
        },
        {
          path: '/application/:id',
          component: ApplicationDetails,
        },
        {
          path: '/log',
          component: LogList,
        },
        {
          path: '/user',
          component: UserList,
        },
        {
          path: '/setting',
          component: ServerSetting,
        },
      ],
    },
    {
      path: '/login',
      component: Login,
    },
  ],
})
